package com.wb.mianxiangduixiang.租车系统;

/**
 * @author 石小俊
 * @date 2025年07月21日 16:03
 */

/**
 * 继承自MotorVehicle，实现自己的租金计算逻辑
 */
public class Bus extends MotorVehicle {
    private int seatCount;

    public Bus(String no, String brand, int seatCount) {
        super(no, brand);
        this.seatCount = seatCount;
    }

    public int getSeatCount() {
        return seatCount;
    }

    public void setSeatCount(int seatCount) {
        this.seatCount = seatCount;
    }

    @Override
    public double rent(int day) {
        double sum = 0.0;
        // 此处通过座位数判断租金
        if (seatCount <= 30) {
            sum = 1000 * day;
        } else {
            sum = 2000 * day;
        }
        return sum;
    }
}
